/*
 *
 */
package org.jiscinvolve.astrodabis.barberry.common.core;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import static org.junit.Assert.*;

import org.springframework.beans.factory.annotation.Autowired;  

import org.jiscinvolve.astrodabis.barberry.common.test.TestBase;

/*
 *
 */
public abstract class CoreTestBase
extends TestBase
    {

    /**
     * Our test Account.
     *
     */
    private Account account ;
    public Account account()
        {
        return this.account;
        }

    /**
     * Create a new Account at the start of the test.
     *
     */
    @Before
    public void before()
        {
        super.before();
        account = womble().accounts().create(
            unique(
                "test-account"
                ),
            "test-pass"
            );
        }

    public void compare(Tag one, Tag two)
        {
        assertNotNull(
            one
            );
        assertNotNull(
            two
            );
        assertEquals(
            one,
            two
            );
        assertEquals(
            one.ident(),
            two.ident()
            );
        assertEquals(
            one.name(),
            two.name()
            );
        assertEquals(
            one.text(),
            two.text()
            );
        compare(
            one.owner(),
            two.owner()
            );
        }


    public void compare(Account one, Account two)
        {
        assertNotNull(
            one
            );
        assertNotNull(
            two
            );
        assertEquals(
            one,
            two
            );
        assertEquals(
            one.ident(),
            two.ident()
            );
        assertEquals(
            one.name(),
            two.name()
            );
        }

    }

